<html>
<title>Release Process</title>
<body>
<h2>Release Process</h2>

<h3>First time set up</h3>
<ul>
  <li>Make sure you have at least a Committer role</li>
  <li>Make sure you have permission to post to the <a
    href="http://google-http-java-client.blogspot.com/">Announcement Blog</a>.</li>
  <li>Download <a href="http://sourceforge.net/projects/javadiff/">JDiff</a>.</li>
  <li>Set up for pushing to central Maven repository
  <ul>
    <li>Sign up for a Sonatype JIRA account at <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>. Click
    <i>Sign Up</i> in the Login box, fill out the simple form, and click <i>Sign
    Up</i>.</li>
    <li>Install a GPG client from <a href="http://www.gnupg.org/">http://www.gnupg.org/</a>,
    and then create a GPG key using <a
      href="http://www.sonatype.com/people/2010/01/how-to-generate-pgp-signatures-with-maven/">these
    instructions</a>, making sure to specify a passphrase to be used every time you
    release. Make sure to run the instructions under "Distribute Your Public
    Key".</li>
    <li>Add these lines to your <code>~/.hgrc</code>: <pre><code>
[ui]
username = Your Name <i>&lt;yourname@domain.com&gt;</i>

[auth]
google-http-java-client.prefix = https://google-http-java-client.googlecode.com/hg/
google-http-java-client.username = <i>[username from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
google-http-java-client.password = <i>[password from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
javadoc-google-http-java-client.prefix = https://javadoc.google-http-java-client.googlecode.com/hg/
javadoc-google-http-java-client.username = <i>[username from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i>
javadoc-google-http-java-client.password = <i>[password from <a
      href="https://code.google.com/hosting/settings">https://code.google.com/hosting/settings</a>]</i></code></pre></li>
    <li>Add these lines to your <code>~/.m2/settings.xml</code> (create
    this file if it does not already exist): <pre><code>&lt;settings&gt;
  &lt;servers&gt;
    &lt;server&gt;
      &lt;id&gt;google-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;google-releases&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-snapshots&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
    &lt;server&gt;
      &lt;id&gt;sonatype-nexus-staging&lt;/id&gt;
      &lt;username&gt;<i>[username for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/username&gt;
      &lt;password&gt;<i>[password for <a
      href="https://issues.sonatype.org/">https://issues.sonatype.org</a>]</i>&lt;/password&gt;
    &lt;/server&gt;
  &lt;/servers&gt;
&lt;/settings&gt;</code></pre></li>
  </ul>
  </li>
</ul>

<h3>Fork version 1.6.0-beta</h3>
This is done in preparation for release of the 1.6 branch 1-2 weeks before the official launch.  We create a named Mercurial branch for 1.6.  Development in the default Mercurial branch may then progress for the next minor version.
<ul>
  <li>Create the Mercurial named branch: <pre>
hg branch 1.6
hg commit -m "create 1.6 branch in preparation for release"
hg push
hg update default
</pre></li>
    <li>For the following files, replace <code>1.6.0-beta</code> with the next minor version:
    <pre>
pom.xml
*/pom.xml
jdiff.xml (first change "1.6" to next minor version, then change "1.5" to "1.6")
release.html (first change "1.6" to next minor version, then change "1.5" to "1.6")
google-http-client/src/main/java/com/google/api/client/util/Strings.java
</pre></li>
    <li>Commit and push: <pre>
hg commit -m "Start next minor version"
hg push
</pre></li>
</ul>

<h3>Release version 1.6.0-beta</h3>
This process is followed for the official launch.  We are releasing the code from the 1.6 Mercurial branch.
<ul>
  <li>Prepare the project
  <ul>
    <li><pre>
cd /tmp
rm -rf google-http-java-client
mkdir google-http-java-client
cd google-http-java-client
hg clone -b 1.6 https://google-http-java-client.googlecode.com/hg/ 1.6
cd 1.6
</pre></li>
  </ul>
  </li>
  <li>Push to central Maven repository (based on instructions from <a
    href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">Sonatype
  OSS Maven Repository Usage Guide</a>):
  <ul>
    <li>Prepare:<pre>
mvn clean deploy
mvn release:clean
</pre></li>
    <li><code>mvn release:prepare -DautoVersionSubmodules=true</code>
    <ul>
      <li>Accept default for 'What is the release version for "Parent for the Google HTTP Client Library for Java"?'</li>
      <li>Type <code>1.6.0-beta</code> for 'What is SCM release tag or label for "Parent for the Google HTTP Client Library for Java"?'</li>
      <li>Accept default for 'What is the new development version for
      "Parent for the Google HTTP Client Library for Java"?'</li>
    </ul>
    </li>
    <li><code>mvn release:perform -Darguments=-Dgpg.passphrase=<i>[YOUR
    GPG PASSPHRASE]</i></code></li>
    <li>Release on oss.sonatype.org
    <ul>
      <li>Log in to <a href="https://oss.sonatype.org">https://oss.sonatype.org</a></li>
      <li>Click on "Staging Repositories" and look for the "com.google"
      Repository with your username</li>
      <li>check box next to uploaded release</li>
      <li>click Close button; type <code>1.6.0-beta</code> and click Close</li>
      <li>check box next to uploaded release</li>
      <li>click Release button; type <code>1.6.0-beta</code> and click
      Release</li>
    </ul>
    </li>
    <li>Central Maven repository is synced hourly. Once uploaded onto
    repo2.maven.org, it will be found at: <a
      href="http://repo2.maven.org/maven2/com/google/http-client/google-http-client/1.6.0-beta/">repo2.maven.org</a></li>
  </ul>
  </li>
  <li>Start development of next bug fix version
  <ul>
    <li><code>hg update</code></li>
    <li>For the following files, replace <code>1.6.0-beta</code> with the next bug fix version:
    <ul>
      <li><code>jdiff.xml</code></li>
      <li><code>release.html</code></li>
      <li><code>google-http-client/src/main/java/com/google/api/client/util/Strings.java</code></li>
    </ul>
    </li>
    <li><pre>
hg commit -m "start next bug fix version"
hg push
</pre></li>
  </ul>
  </li>
  <li>Prepare the released library zip file and javadoc
  <ul>
    <li>Overview: JDiff is a tool for showing the difference between the JavaDoc of
    one version of the library vs. the JavaDoc of an old version of the library.
    Hence, we will check out the last minor version of the library into a
    temporary directory and compare against the JavaDoc of the just released
    version of the library, and then hg commit that diff into the javadoc Hg
    repository.</li>
    <li><pre>
cd /tmp/google-http-java-client
hg clone --insecure https://javadoc.google-http-java-client.googlecode.com/hg/ javadoc
hg clone -r 1.5.1-beta https://google-http-java-client.googlecode.com/hg/ 1.5.1-beta
hg clone -r 1.6.0-beta https://google-http-java-client.googlecode.com/hg/ 1.6.0-beta
cd 1.6.0-beta
mvn javadoc:jar install site
cp -R target/site/apidocs ../javadoc/1.6.0-beta
</pre></li>
    <li>change these constants from jdiff.xml for your environment:
    JDIFF_HOME, MAVEN_REPOSITORY_HOME</li>
    <li><pre>
ant -f jdiff.xml
cd ../javadoc
hg add
hg commit -m "1.6.0-beta"
hg push --insecure
</pre></li>
  </ul>
  </li>
  <li><b>WAIT!</b> Don't do the following instructions until after the
  library has been uploaded to repo2.maven.org at: <a
    href="http://repo2.maven.org/maven2/com/google/http-client/google-http-client/1.6.0-beta/">repo2.maven.org</a></li>
  <li>Update to new version on <a
    href="http://code.google.com/p/google-http-java-client">http://code.google.com/p/google-http-java-client</a>
  <ul>
    <li>Upload to <a
      href="http://code.google.com/p/google-http-java-client/downloads/entry">http://code.google.com/p/google-http-java-client/downloads/entry</a>
    <ul>
      <li>Summary: Google HTTP Client Library for Java, version 1.6.0-beta</li>
      <li>File: <code>/tmp/google-http-java-client/1.6.0-beta/google-http-client-assembly/target/google-http-client-1.6.0-beta-java.zip</code></li>
      <li>Labels: <code>Type-Archive</code>, <code>OpSys-All</code>, and <code>Featured</code></li>
      <li>click Submit file</li>
    </ul>
    </li>
    <li>If it is a bug fix release, deprecate the library from any previous
    versions by removing any <code>Featured</code> label and adding the <code>Deprecated</code>
    label.</li>
  </ul>
  </li>
  <li><a
    href="http://www.blogger.com/post-create.g?blogID=4291939896242474921">New
  Post</a> on the <a href="http://google-http-java-client.blogspot.com/">announcement
  blog</a> about the new version, including links to <a
    href="http://code.google.com/p/google-http-java-client/issues/list?can=1&q=milestone=Version1.6.0%20status=Fixed&colspec=ID%20Type%20Priority%20Summary">new
  features and bugs fixed</a>.</li>
</ul>
</body>
</html>
